/**
 * Created by Administrator on 2017/5/20 0020.
 */
$(function () {
    //控制导航栏默默认样式及滑过效果、二级菜单弹出
    $(".hd-nav>li").eq(0).children("a").css("color","#ff0000")
    $(".hd-nav>li").on({
        mouseover:function () {
            $(".hd-nav>li").eq(0).children("a").css("color","#fff")
            $(this).children("a").css("color","#DB1508");
            $(this).children("div").show();
        },
        mouseout:function () {
            $(this).children("a").css("color","#fff");
            $(this).children("div").hide();
        }
    })

    //控制购物车滑过弹出
    $(".shopcar").on({
        mouseover:function () {
            $(".shopping").show();
            $(".shopping-close").click(function () {
                $(this).parent().hide();
            })
        },
        mouseout:function () {
            $(".shopping").hide();
        }
    })

//    控制滚动时，让导航栏固定在顶部
    $(document).scroll(function () {
        $(this).scrollTop()>$(".header").height()?$(".nav-wrap").css({
            "position":"fixed","left":0,"top":0,"z-index":999
            }):$(".nav-wrap").css("position","static");
    })



})